unit TestCon;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Edit, RzPanel, ExtCtrls, RzDlgBtn, StdCtrls, RzLabel, Mask,
  RzEdit, RzButton, RzCmboBx;

type
  TTestConFrm = class(TEditFrm)
    RzLabel1: TRzLabel;
    RzNumericEdit1: TRzNumericEdit;
    RzLabel2: TRzLabel;
    RzButton1: TRzButton;
    RzComboBox1: TRzComboBox;
    procedure RzDialogButtons1ClickCancel(Sender: TObject);
    procedure RzButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  TestConFrm: TTestConFrm;

implementation

uses CDefine;

{$R *.dfm}

procedure TTestConFrm.RzDialogButtons1ClickCancel(Sender: TObject);
begin
  inherited;
  Close;
end;

procedure TTestConFrm.RzButton1Click(Sender: TObject);
var
  outi, outv: word;
begin
  inherited;
  if (RzComboBox1.ItemIndex = 0) then
  begin
    ResetLowCom1;
    SendOnLineCom1;
     outi:= Round(RzNumericEdit1.Value*65.52)+819;
     outv:= Round(RzNumericEdit1.Value*81.9);
     SendDAOutCom1(outi,outv);    
    CloseCommCom1;
  end;

  if (RzComboBox1.ItemIndex = 1) then
  begin
    ResetLowCom2;
    SendOnLineCom2;
    outi:= Round(RzNumericEdit1.Value*65.52)+819;
    outv:= Round(RzNumericEdit1.Value*81.9);
    SendDAOutCom2(outi,outv);
    CloseCommCom2;
  end;

  if (RzComboBox1.ItemIndex = 2) then
  begin
    ResetLowCom3;
    SendOnLineCom3;
     outi:= Round(RzNumericEdit1.Value*65.52)+819;
     outv:= Round(RzNumericEdit1.Value*81.9);
     SendDAOutCom3(outi,outv);    
    CloseCommCom3;
  end;

  if (RzComboBox1.ItemIndex = 3) then
  begin
    ResetLowCom4;
    SendOnLineCom4;
    outi:= Round(RzNumericEdit1.Value*65.52)+819;
    outv:= Round(RzNumericEdit1.Value*81.9);
    SendDAOutCom4(outi,outv);
    CloseCommCom4;
  end;
end;

end.
